#include "FireVulnerability.h"

#include "Character.h"
#include "Target.h"

FireVulnerability::FireVulnerability(Character* pchar) :
    SharedDebuff(pchar, "Fire Vulnerability", "Assets/spell/Spell_fire_soulburn.png", Priority::Mid, 30, 0) {
    max_stacks = 5;
}

void FireVulnerability::buff_effect_when_applied() {
    if (current_stacks == max_stacks)
        return;

    if (current_increment > 0)
        pchar->get_target()->decrease_magic_school_damage_mod(current_increment, MagicSchool::Fire);
    current_increment += increment;
    pchar->get_target()->increase_magic_school_damage_mod(current_increment, MagicSchool::Fire);
}

void FireVulnerability::buff_effect_when_removed() {
    pchar->get_target()->decrease_magic_school_damage_mod(current_increment, MagicSchool::Fire);
    current_increment = 0;
}

void FireVulnerability::buff_effect_when_refreshed() {
    buff_effect_when_applied();
}
